//
//  KSLibViewController.m
//  KSLib
//
//  Created by User on 9/10/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "KSLibViewController.h"
#import "KSFolderFunc.h"
#import "KSFileFunc.h"
#import "NSString+Useful.h"

@implementation KSLibViewController

@synthesize txtName;




- (void)dealloc
{
    [super dealloc];
    
    //parser = nil;
    //[parser release];
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
 
    UITableViewCell *cell = [[UITableViewCell alloc]
                             initWithStyle:UITableViewCellStyleDefault
                             reuseIdentifier:@"cell"];
    
    cell.textLabel.text = [[[parser rssCol] objectAtIndex:indexPath.row] title] ;
    
    return  cell;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
  
    return [[parser rssCol] count]; 
    
}

// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
{
    


    
    [super viewDidLoad];
    
   
     //parser = [[KSRssParser alloc] loadRssByURL:@"http://www.abc.net.au/bestof/bestofabc.xml"];
    
    //NSString *st = @"12";
    //NSLog(@"%d",(int)[st isNumeric]);
    
    NSString *sp = @"<?xml version=\"1.0\" encoding=\"utf-8\"?>"
    "<soap12:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
    "xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" "
    "xmlns:soap12=\"http://www.w3.org/2003/05/soap-envelope\"> "
    "<soap12:Body>"
    "<GetCountries xmlns=\"http://www.webserviceX.NET\" />"
    "</soap12:Body>"
    "</soap12:Envelope>";
    
    srv1 = [[KSWebService alloc]init];
    
    [srv1 callWebService: sp 
            andServiceLocaion:@"http://www.webservicex.net/country.asmx"
            andContentType:@"application/soap+xml; charset=utf-8"
            andSoapAction:@""
            andMethod:@"POST"];
    
    
    
    NSString *theXML = [[NSString alloc]						
                        initWithBytes: [[srv1 webData]  mutableBytes]						
                        length:[[srv1 webData]  length]						
                        encoding:NSUTF8StringEncoding];
    
    
    
   NSLog(@"%@",theXML );
    NSLog(@"Last");
    
    [srv1 release];

}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@end
